<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script>
     var arr=['b','c','d','a'];//给字符串排序
      //arr.sort();
     //或者
    // alert(arr);
     alert(arr.sort());

    </script>
</head>
<body>

</body>
</html>